/*************************************
 * Created by WebStorm
 * Author : 菲尔敦
 * QQ邮箱：2891044172@qq.com  手机号：15981761402
 * Created Time :2024/2/5 18:17
 Desc : 获取窗口大小
 **************************************/
import { onMounted, onUnmounted, ref } from 'vue';
export function useWindowResize(computeHeight:number=230) {
    const width = ref(0);
    const height = ref(0);
    function onResize() {
        width.value = window.innerWidth;
        height.value = parseFloat(String(window.innerHeight))-computeHeight;
    }
    onMounted(() => {
        window.addEventListener('resize', onResize);
        onResize();
    });
    onUnmounted(() => {
        window.removeEventListener('resize', onResize);
    });
    return {
        width,
        height
    };
}
